Systems including virtual machines (VMs) allow the sharing of an underlying physical machine and its resources. The software layer providing virtualization to the VMs is referred to as a virtual machine monitor (VMM) or hypervisor. A VMM acts as a host to the VMs. The VMM presents system software executing on the VMs (e.g., operating system software and application software) with an abstraction of the physical machine. The VMM is further able to retain selective control of processor resources, physical memory, interrupt management and data I/O.
I/O virtualization describes the capability for a single physical I/O unit to be shared by more than one VM. Prior art solutions accomplish I/O virtualization via a software module. Thus all accesses to VM memory pages are initiated from the CPU, and thereby incurring significant processing overhead. Furthermore, this type of virtualization does not allow devices assigned to VMs to execute memory operations directly via Direct Memory Access (DMA).
Other prior art solutions accomplish I/O virtualization via hardware logic, also known as directed I/O. In these solutions, a device's DMA requests are restricted to memory domains and memory regions assigned (by the VMM) to the VM that owns the device. One of these hardware prior art solutions may be described as DMA remapping hardware—i.e., a hardware unit positioned between the DMA capable peripheral devices and the system's physical memory. Unmodified drivers may run seamlessly in a VM will full privilege on I/O resources assigned to that VM; however, because DMA protection is enforced at the chipset level, access to physical memory outside of the VM-owned physical pages is prevented for I/O devices assigned to that VM.
Some advanced computer server memory features require the ability to “hot-remove” or “hot-swap” memory (e.g., removing DIMMs while they are in use). Hot swapping memory involves moving the content of (at least) one in-use page to another page, without breaking ongoing executions.
Hot-swapping memory is possible in the prior art if I/O virtualization is done via a software module. In this scenario, a VMM freezes the respective VM to prevent race access when page content is being swapped. After new mapping is established, the VM is thawed and subsequent memory accesses are redirected to newly mapped page.
However, there is no ability to hot swap pages of VM with I/O virtualization that allows directed I/O. This is due, in part, to the fact that a VMM can freeze VM execution, but has no control over devices assigned to said VM. These assigned devices can issue DMA requests to VM pages at any time, even when hot swapping of that page is in progress. This race condition is dangerous in that it may cause inconsistency between old and new pages.
Descriptions of certain details and implementations follow, including a description of the figures, which may depict some or all of the embodiments described below, as well as discussing other potential embodiments or implementations of the inventive concepts presented herein. An overview of embodiments of the invention is provided below, followed by a more detailed description with reference to the drawings.